﻿using System;
using System.Net.Http;

namespace Fast.RemoteRequest
{
    [SkipScan]
    public class HttpRemoteRequestOptions
    {
        /// <summary>
        /// 
        /// </summary>
        public Action<HttpClient> ConfigureClient { get; set; }
        
        /// <summary>
        /// 创建 <see cref="HttpClient"/> 对象前拦截器
        /// </summary>
        public Action<HttpRequestMessage> BeforeCreateHttpClient { get; set; }

        /// <summary>
        /// 在发送 Http 请求前拦截器
        /// </summary>
        public Action<HttpRequestMessage> BeforeSendHttpRequest { get; set; }

        /// <summary>
        /// 在 Http 响应结果返回前拦截器
        /// </summary>
        public Action<HttpResponseMessage> BeforeHttpResponse { get; set; }

        /// <summary>
        /// 异常拦截器
        /// </summary>
        public Action<HttpResponseMessage, string> OnException { get; set; }
    }
}
